Skip to content

fix(oauth): remove credential caching to enable automatic token refresh - #33

Merged
its-mash merged 4 commits into
mainfrom
fix/oauth-token-refresh-cache
Feb 5, 2026
Merged

fix(oauth): remove credential caching to enable automatic token refresh#33
its-mash merged 4 commits into
mainfrom
fix/oauth-token-refresh-cache

Conversation

@its-mash

@its-mash its-mash commented Feb 5, 2026

Copy link
Copy Markdown
Member

The DatabaseCredentialStore was caching StoredCredentials with stale expires_in values, preventing RMCP's automatic token refresh from working correctly. After idle periods, tool calls would fail with 401 errors even though tokens should have been refreshed.

Changes:

  • Removed cache field and all caching logic from DatabaseCredentialStore
  • expires_in is now recalculated on every load() from the stored expires_at timestamp
  • RMCP's AuthClient can now properly detect expired tokens and refresh them automatically
  • Added comprehensive tests to verify token expiration detection and refresh behavior

Fixes: OAuth-protected servers (like Atlassian MCP) failing after idle periods

Mohammod Al Amin Ashik and others added 4 commits February 5, 2026 22:06
The DatabaseCredentialStore was caching StoredCredentials with stale expires_in values, preventing RMCP's automatic token refresh from working correctly. After idle periods, tool calls would fail with 401 errors even though tokens should have been refreshed.

Changes:
- Removed cache field and all caching logic from DatabaseCredentialStore
- expires_in is now recalculated on every load() from the stored expires_at timestamp
- RMCP's AuthClient can now properly detect expired tokens and refresh them automatically
- Added comprehensive tests to verify token expiration detection and refresh behavior

Fixes: OAuth-protected servers (like Atlassian MCP) failing after idle periods
- Enable format on save for Rust files
- Configure rust-analyzer to use rustfmt
- Add pre-commit hook to auto-format Rust code before commits
- Ensure consistent line endings (LF) and trim trailing whitespace
@its-mash
its-mash merged commit f398cfa into main Feb 5, 2026
9 of 12 checks passed
@its-mash
its-mash deleted the fix/oauth-token-refresh-cache branch February 5, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant